package net.oschina.app.pages;

import android.widget.ListView;

import com.robotium.solo.WebElement;

import net.oschina.app.testcases.favorites.SoloWrap;

/**
 * Created by Administrator on 2017/7/4.
 */

public class PageNewsDetail {

    ListView list;
    private SoloWrap solo;

    public PageNewsDetail(SoloWrap solo) {
        this.solo = solo;
    }

    public void initViews() {
        solo.waitForView(solo.getView("net.oschina.app:id/listView"));

    }

    public String getWebElementContent(String xpath) {
        WebElement el = solo.getWebElementByXpath(xpath);
        return solo.getWebElementText(el);
    }

    public String getFirstContent() {
        return getWebElementContent("/html/body/div/p[2]");
    }

}
